const path = require('path');
const Config = require('webpack-chain');
const config = new Config();

module.exports = {
  chainWebpack: config => {
    const svgRules = config.module.rule('svg')
    svgRules.uses.clear()
    svgRules.include.add(path.resolve('src/icons')).end()
      .use('svg-sprite-loader').loader('svg-sprite-loader')
      .options({
        'symbolId': 'icon-[name]'
      })
  }
}